<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>SQLRelay</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:root@localhost" />
</head>

<body>



<ul id="index">
  <li><a href="#NAME">NAME</a></li>
  <li><a href="#SYNOPSIS">SYNOPSIS</a></li>
  <li><a href="#DESCRIPTION">DESCRIPTION</a></li>
  <li><a href="#USAGE">USAGE</a>
    <ul>
      <li><a href="#Note-for-HTML::Mason-Users">Note for HTML::Mason Users</a></li>
    </ul>
  </li>
  <li><a href="#AUTHOR">AUTHOR</a></li>
  <li><a href="#SEE-ALSO">SEE ALSO</a></li>
</ul>

<h1 id="NAME">NAME</h1>

<p>DBD::SQLRelay - perl DBI driver for SQL Relay</p>

<h1 id="SYNOPSIS">SYNOPSIS</h1>

<p>use DBD::SQLRelay;</p>

<p>my $dbh = DBI -&gt; connect (&#39;dbi:SQLRelay:$dsn&#39;, $login, $password);</p>

<h1 id="DESCRIPTION">DESCRIPTION</h1>

<p>This module is a pure-Perl DBI binding to SQL Relay&#39;s native API. Connection string consists of following parts:</p>

<dl>

<dt id="host-...-default:-localhost-----hostname-of-SQL-Relay-server"><b>host=...</b> default: <i>localhost</i> --- hostname of SQL Relay server;</dt>
<dd>

</dd>
<dt id="port-...-default:-9000-----port-number-that-SQL-Relay-server-listens-on"><b>port=...</b> default: <i>9000</i> --- port number that SQL Relay server listens on;</dt>
<dd>

</dd>
<dt id="tries-...-default:-1-----how-much-times-do-we-try-to-connect"><b>tries=...</b> default: <i>1</i> --- how much times do we try to connect;</dt>
<dd>

</dd>
<dt id="retrytime-...-default:-0-----time-in-seconds-between-connect-attempts"><b>retrytime=...</b> default: <i>0</i> --- time (in seconds) between connect attempts;</dt>
<dd>

</dd>
<dt id="debug-...-default:-0-----set-it-to-1-if-you-want-to-get-some-debug-messages-in-stdout"><b>debug=...</b> default: <i>0</i> --- set it to 1 if you want to get some debug messages in stdout;</dt>
<dd>

</dd>
</dl>

<h1 id="USAGE">USAGE</h1>

<p>Once connected, DB handler works as usual (see <a>DBI</a>).</p>

<p>Don&#39;t ever try to share one SQLRelay connect by multiple scripts, for example, if you use Apache mod_perl. Every $dbh holds one of server connections, so call disconnect() directly at the end of every script and don&#39;t use Apache::DBI or SQLRelay will be deadlocked.</p>

<h2 id="Note-for-HTML::Mason-Users">Note for HTML::Mason Users</h2>

<p>If you use <a>HTML::Mason</a>, your handler.pl sould look like this:</p>

<pre><code>  ...

     {
       package HTML::Mason::Commands;
       use DBI;
       use vars qw($db);  
     }
 
  ...

     sub handler {
       
       $HTML::Mason::Commands::dbh = DBI -&gt; connect (...);
       
       my $status = $ah -&gt; handle_request (...);
     
       $HTML::Mason::Commands::dbh -&gt; disconnect;
       
       return $status;
              
     }
     </code></pre>

<h1 id="AUTHOR">AUTHOR</h1>

<p>D. E. Ovsyanko, do@mobile.ru</p>

<p>Contributions by:</p>

<p>Erik Hollensbe &lt;erik@hollensbe.org&gt;</p>

<p>Tony Fleisher &lt;tfleisher@musiciansfriend.com&gt;</p>

<h1 id="SEE-ALSO">SEE ALSO</h1>

<p>http://www.firstworks.com</p>


</body>

</html>


